package serverMessage;

import java.io.Serializable;

/**
 * class ServerMessage - symbolize a message from the server to the client
 */
public class ServerMessage implements Serializable {
	
	private String userID;
	private String kindRequest;
	private String folderName;
	private String fileName;
	private byte[] byteFile;
	
	/**
	 * constructor
	 * @param userID - the user name that the message is for him
	 * @param kindRequest - the kind of the message
	 * @param folderName - the folder name
	 * @param fileName - the file name
	 * @param byteFile - the file content
	 */
	public ServerMessage(String userID, String kindRequest, String folderName, String fileName,  byte[] byteFile)
	{
		this.userID = userID;
		this.kindRequest = kindRequest;
		this.folderName = folderName;
		this.fileName = fileName;
		this.byteFile = byteFile;
	}
	
	/**
	 * return a string with the message details
	 */
	public String toString()
	{
		return "kind " +kindRequest + " folder name " +  folderName + " fileName " + fileName;
	}
	
	/**
	 * @return the user name that the message is for him
	 */
	public String getUserID() {
		return userID;
	}
	
	/**
	 * @return the kind of the message
	 */
	public String getKindRequest() {
		return kindRequest;
	}
	
	/**
	 * @return the folder name
	 */
	public String getFolderName() {
		return folderName;
	}
	
	/**
	 * @return the file name
	 */
	public String getFileName() {
		return fileName;
	}
	
	/**
	 * @return the file content
	 */
	public byte[] getByteFile() {
		return byteFile;
	}


}
